package com.android.ouderenvervoer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MenuActivity extends Activity{
	/** Called when the activity is first created. */
	Button buttonPlanReis, buttonMijnReizen, buttonMijnGegevens, buttonInstellingen, buttonAflsuiten;
	
	
	
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
    	super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);
	    
//	    TextView text = (TextView) findViewById(R.id.test);
	    
	    setupViews();
	    addButtonListeners();
	   
	 //   SoapConnector sc = new SoapConnector("getUser");
	    Log.d("output", "1" );   
       // sc.addRequestProperty("id", "1");
        Log.d("output", "2" ); 
       // Log.d("output", "output" + sc.executeRequest().toString() );       
        //sc.executeRequest();
       
        //text.setText("tim"+ sc.executeRequest() );
	    
    }
    
    /**
     * creates references and listeners for the GUI interface
     */
    private void setupViews()
    {
    	// THE BUTTONS
        buttonPlanReis = 		(Button)findViewById(R.id.buttonPlanReis);
        buttonMijnReizen = 		(Button)findViewById(R.id.buttonMijnReizen);
        buttonMijnGegevens = 	(Button)findViewById(R.id.buttonMijnGegevens);
        buttonInstellingen = 	(Button)findViewById(R.id.buttonInstellingen);
        buttonAflsuiten =		(Button)findViewById(R.id.buttonAfsluiten);
    }
    /**
     * adds listeners to each of the buttons and sets them to call relevant methods
     */
	private void addButtonListeners() {
		 buttonPlanReis.setOnClickListener
	    	(
	    		new View.OnClickListener()
		    	{
	    			@Override public void onClick(View v) {
		    			Intent planreisActivity = new Intent(v.getContext(), PlanReisActivity.class);
		    			startActivityForResult(planreisActivity,0);
	    			}
				}
	    	);
		 buttonMijnReizen.setOnClickListener
	    	(
	    		new View.OnClickListener()
		    	{
	    			@Override public void onClick(View v) {
		    			Intent mijnreizenActivity = new Intent(v.getContext(), MijnReizenActivity.class);
		    			startActivityForResult(mijnreizenActivity,0);
	    			}
				}
	    	);
		 buttonMijnGegevens.setOnClickListener
	    	(
	    		new View.OnClickListener()
		    	{
	    			@Override public void onClick(View v) {
		    			Intent mijngegevensActivity = new Intent(v.getContext(), MijnGegevensActivity.class);
		    			startActivityForResult(mijngegevensActivity,0);
	    			}
				}
	    	);
		 buttonInstellingen.setOnClickListener
	    	(
	    		new View.OnClickListener()
		    	{
	    			@Override public void onClick(View v) {
		    			Intent instellingenActivity = new Intent(v.getContext(), InstellingenActivity.class);
		    			startActivityForResult(instellingenActivity,0);
	    			}
				}
	    	);
		 buttonAflsuiten.setOnClickListener
	    	(
	    		new View.OnClickListener()
		    	{
	    			@Override public void onClick(View v) {
		    			System.exit(0);
		    			System.exit(1);
	    			}
				}
	    	);
	}
}
